import api from './index'
// import qs from 'qs'
// axios
import request from '@/utils/request'
// cardInfo api

//获取个人信息
export function getUserInfo() {
  return request({
    url: api.UserInfo,
    method: 'get',
    hideloading: true
  })
}

//改变手机号码
export function UpdatePhone(data) {
  return request({
    url: api.UpdatePhone,
    method: 'post',
    data,
    hideloading: true
  })
}

//绑定手机号码
export function bindMobile(data) {
  return request({
    url: api.bindMobile,
    method: 'Post',
    data
  })
}

//获取短信验证码
export function GetCodeSms(data) {
  return request({
    url: api.GetCodeSms,
    method: 'post',
    data,
    hideloading: true
  })
}

// 获取用户卡券列表
export function GetCardList(params) {
  return request({
    url: api.GetCardList,
    method: 'get',
    params,
    hideloading: true
  })
}

// 获取使用卡券时的服务器时间戳
export function GetTimeStamp(params) {
  return request({
    url: api.GetTimeStamp,
    method: 'get',
    params,
    hideloading: true
  })
}

// 第三方二维码卡券
export function qrCodesignature(params) {
  return request({
    url: api.QrCodesignature,
    method: 'get',
    params,
    hideloading: true
  })
}

//兑换优惠券
export function updateUserCard(params) {
  return request({
    url: api.updateUserCard,
    method: 'get',
    params,
  })
}


// 根据卡券ID获取卡券详情
export function CardDetailById(params) {
  return request({
    url: api.CardDetailById,
    method: 'get',
    params
  })
}
